package com.gitee.demo.web;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.support.hsf.HSFJSONUtils;
import com.gitee.demo.param.common.QuanMinErrorCode;
import com.gitee.demo.param.common.Result;
import com.gitee.demo.param.vo.ParamVO;
import io.swagger.annotations.*;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;



/**
 * @author Tao on 2020/7/24
 */
@RestController
@Api(value = "陕西高速", description = "陕西高速-测试服务")
@RequestMapping(value = "/shanxi", produces = "application/json; charset=UTF-8")
public class APIController {

    @ApiOperation(value = "银行卡列表接口", notes = "银行卡列表接口")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "银行卡列表接口"),
            @ApiResponse(code = 500, message = "500(系统错误)", response = String.class)
    })
    @RequestMapping(value = "/test", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    @ResponseBody
    public Result<List<ParamVO>> test(
            @ApiParam(value = "参数", required = true) @RequestBody ParamVO paramVO) {



        List<ParamVO> list=new ArrayList<>();
        list.add(paramVO);
        list.add(paramVO);

        String string = JSON.toJSONString(paramVO);
        System.out.println(string);
        Result instance = Result.instance(list);
        String string1 = JSON.toJSONString(instance);
        System.out.println(string1);

        return instance;
    }

    @ApiOperation(value = "银行卡列表接口", notes = "银行卡列表接口")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "银行卡列表接口"),
            @ApiResponse(code = 500, message = "500(系统错误)", response = String.class)
    })
    @RequestMapping(value = "/test1", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    @ResponseBody
    public String test1(
            @ApiParam(value = "参数", required = true) @RequestBody List<Integer> policyIdList) {

        String string = JSON.toJSONString(policyIdList);
        System.out.println(string);



        return string;
    }


    public static void main(String[] args) {
        System.out.println(1);

    }

}
